package Java.BlackHorse.Stream;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Stream;

public class StreamDemo1 {
    public static void main(String[] args) {
    //单列集合的Stream流
        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list,"a","b","c","d","e","f");

        //把集合list放到stream流水线上
        Stream<String> stream1 = list.stream();

//        stream1.forEach(new Consumer<String>() {
//            @Override
//            public void accept(String s) {
//                System.out.print(s+" ");
//            }
//        });
        stream1.forEach(s -> System.out.print(s+" "));
    }
}
